package com.example.service;


import com.example.bean.Event;
import com.example.mapper.EventMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EventService {

    @Autowired
    EventMapper mapper;

    public List<Event> selectEvent(String eventsName) {
        eventsName = "%" + eventsName + "%";
        return mapper.selectEvent(eventsName);
    }

    public void addEvent(Event event) {
        mapper.addEvent(event);
    }

    public void deleteEvent(int eventsId) {
        mapper.deleteEvent(eventsId);
    }

    public List<Event> selectEventNear() {
        return mapper.selectEventNear();
    }

    public List<Event> selectAll() {
        return mapper.selectAll();
    }
}